package com.cskaoyan.controller;

import com.cskaoyan.bean.data.CatalogyData;
import com.cskaoyan.bean.data.CatalogyListData;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {
    @Autowired
    private CategoryService categoryService;

    @RequestMapping("current")
    public BaseRespVo current(int id) {
        CatalogyData data = categoryService.queryCurrentById(id);
        return BaseRespVo.ok(data);
    }

    @RequestMapping("index")
    public BaseRespVo index() {
        CatalogyListData data = categoryService.querCurrentList();
        return BaseRespVo.ok(data);
    }
}
